/*    */ package net.sourceforge.appgen.support;
/*    */ 
/*    */ import net.sourceforge.appgen.editor.MappingDataEditor;
/*    */ import net.sourceforge.appgen.model.Entity;
/*    */ import org.eclipse.jface.resource.ImageDescriptor;
/*    */ import org.eclipse.jface.resource.ImageRegistry;
/*    */ import org.eclipse.jface.viewers.ITableLabelProvider;
/*    */ import org.eclipse.jface.viewers.LabelProvider;
/*    */ import org.eclipse.swt.graphics.Image;
/*    */ 
/*    */ public class EntityTableLabelProvider extends LabelProvider
/*    */   implements ITableLabelProvider
/*    */ {
/* 33 */   private static ImageRegistry imageRegistry = new ImageRegistry();
/*    */   public static final String CHECKED_IMAGE = "checked";
/*    */   public static final String UNCHECKED_IMAGE = "unchecked";
/*    */ 
/*    */   static
/*    */   {
/* 39 */     String iconPath = "icon/";
/* 40 */     imageRegistry.put("checked", ImageDescriptor.createFromFile(MappingDataEditor.class, iconPath + "checked" + ".gif"));
/* 41 */     imageRegistry.put("unchecked", ImageDescriptor.createFromFile(MappingDataEditor.class, iconPath + "unchecked" + ".gif"));
/*    */   }
/*    */ 
/*    */   public Image getColumnImage(Object element, int columnIndex) {
/* 45 */     if (columnIndex == 0) {
/* 46 */       Entity entity = (Entity)element;
/*    */ 
/* 48 */       return entity.isCreate() ? imageRegistry.get("checked") : imageRegistry.get("unchecked");
/*    */     }
/*    */ 
/* 51 */     return null;
/*    */   }
/*    */ 
/*    */   public String getColumnText(Object element, int columnIndex) {
/* 55 */     Entity entity = (Entity)element;
/*    */ 
/* 57 */     switch (columnIndex) {
/*    */     case 0:
/* 59 */       return "";
/*    */     case 1:
/* 61 */       return entity.getTableName();
/*    */     case 2:
/* 63 */       return entity.getBaseName();
/*    */     }
/* 65 */     throw new RuntimeException("column index out of range. " + columnIndex);
/*    */   }
/*    */ }

/* Location:           C:\Users\lzl6066\Downloads\net.sourceforge.appgen_1.2.0\plugins\net.sourceforge.appgen_1.2.0.201002031718\
 * Qualified Name:     net.sourceforge.appgen.support.EntityTableLabelProvider
 * JD-Core Version:    0.6.0
 */